Thermodynamic aspects of first order phase transformations with hysteresis in magnetic materials