Topological electronic transition in cuprate high-Tc superconductors occurring before the superconducting transition