Improper ferroelectric polarization in a perovskite driven by intersite charge transfer and ordering