Unless something recently changed, you don't on T-mobile.
Back when the s9 line was released, we traded our old phones in at T-Mobile for a new s9+ and s9 & received monthly bill credits for each device. My husband didn't like the s9, so next year, when the s10 line came out, he paid off his s9 at T-Mobile. He then took his paid off s9 to Best Buy & traded it in on an
unlocked s10+. We continued to get both sets of bill credits. As long as he kept his phone line, there was no problem. On top of it all, we have a really cheap plan.