Two-photon spectroscopy of dipole-forbidden transitions