Exactly, that's the way we highly recommend going about with it, when it comes to domain transfers. It is unwise to attempt a transfer immediately before it expires.
Let's say if your domain has met all the necessary requirements, then it can take as short as 3 business days for the transfer to complete. However, this is not a guarantee that it will happen to your domain transfer all the time. It also depends on your registrar's response to our transfer request. If they failed to respond the process, it will be something beyond our control. This creates an unnecessary risk for your domain.
To avoid this, users should either transfer well before the expiration date or renew the domain before attempting the transfer.
Hope that helps, and if you have any other questions - please feel free to ask. Thanks!