Phase transition from the symmetry breaking of charged Klein–Gordon fields