Convert from a POP3 account to IMAP

I’m currently using a POP3 account but want to switch that to an IMAP account. Looking at my account settings, POP3 is grayed out so I can’t simply change that to IMAP.

How do I change from POP3 to IMAP without losing my current emails?