Continuous and discontinuous phase transitions in the evolution of a polygenic trait under stabilizing selective pressure