Mechanical energy criterion for stress-induced martensitic transformation