Phase Transformations and Generation of Heat Treatment Residual Stresses in Metallic Alloys