Generalized Ehrenfest’sapproach to phase transitions in multicomponent systems in the presence of electromagnetic field