Do you have any messages in the POP3 account that are no longer on the server? If not, you can just delete the POP3 account and setup the IMAP account.

If you do have messages in the POP3 account that are no longer on the server, don't delete the POP3 account and set up the IMAP account. Then, drag the messages that are no longer on the server from the POP3 account to the "Inbox" IMAP folder view under the you@example.com access point in the mail panel for the IMAP account. That will upload the POP3 messages back to the server where the IMAP account will then download them. Once all done, you can delete the POP3 account.