Thermal dynamics of side-chain copolymethacrylates as studied by the dielectric spectroscopy and relaxation of second-harmonic generation