Constraints on the phase transition of early dark energy with the CMB anisotropies