Electronic structure and the theory of phase transformations in NiMn