$PT$ symmetry and a dynamical realization of the SU(1,1) algebra