Thermoelastic Martensitic Transformations and the Nature of the Shape Memory Effect