A micromechanical model of the martensitic transformation