Thank you for asking this question on the **Microsoft Q&A Platform. **
You won't be for to disable legacy authentication, but it is strongly recommended to disable it
There is a way to Authenticate an IMAP, POP or SMTP connection using OAuth
Hope this helps,
Carlos Solís Salazar
----------
Accept Answer and Upvote, if any of the above helped, this thread can help others in the community looking for remediation for similar issues.
NOTE: To answer you as quickly as possible, please mention me in your reply.