Just passed trial period at AT&T and hate that place with a vengeance. Since I am on the hook with Iphone 14 Pro with ATT, was wondering if I can just take it to T Mobile or do I have to pay it off first?

Will the phone work on T Mobile Network same as if I bought it from them?