Default How do I install a safestrap rom with i337 being unlocked to Tmobile

I'm trying to help a friend install some roms on his att gs4. I'm familiar with Tmobile s4 since i have one and often install custom roms but with att phone i see its a little different.

My main question is how do I get a rom on his phone without losing Tmobile unlock privileges he currently has.

also if someone could explain how this whole loki thing works that'd be awesome, like can i install tmo rom on his 337 or only att made roms

he's probably just looking to install a nice stable tw rom that is up to date with either 4.4.2 or 4.3