Energy-efficient Training of Distributed DNNs in the Mobile-edge-cloud Continuum