Revealing two-stage phase transition process in defective KTaO3 under inelastic interactions