Evolution of localization in NiTi shape memory alloys and its effect on structures