Cycles of least mass in a riemannian manifold, described through the 'phase transition' energy of a line bundle