No, there are no rules I am aware of as a domain reseller, but it might differ with some of the new TLDs. It might be worth clarifying with ICANN.
There are somethings to be mindful of.
It generally takes 3 - 5 days for a transfer to complete. I would never start a transfer less than a week prior to expiration if I wanted to avoid disruption.
many TLDs require renewal on transfer so it can be a good idea to transfer wellnot renew too far in advance of the expiry date unless you are happy to renew and then have to add another year on transfer
nameservers can't be updated once a domain transfer has been approved by the registrant.