In-situ TEM investigation of the phase transitions in perovskite ferroelectrics