That isn't exactly the criteria. Only the original trainer can change the name. So, if you trade your Machoke to a friend, you can't change the name of his pokemon and he can't change the name of the Machamp. If you trade back and you have your original Machamp, you can still change its name. It's not like once it's traded, the name is fixed for all eternity as the OT can still change it.