Thermodynamics of ferromagnetic crystals with a non-Euclidean structure as internal variable in a continuum description