Whew, just triedit on 10.6.5, it sure throws a bit of a roadblock or 3 to us, but...
If you cannot edit the servers to the new iCloud ones, then...
Quit Mail, in Finder goto...
/Users/YourUserName/Library/Mail/IMAP-YourMailName@imap.mail.me.com
Right click or control+click, choose duplicate, once done, start Mail, goto Mail Preferences>Accounts,highlight the old MobileMe accounts, click the little minus icon below, then setup a bew IMAP account.
If worried about losing anything...
On Mail...
First Quit Mail, then I'd backup these two Mail folders, by right clicking on them in the Finder, then choose Archive/Compress.
Users/YourUserName/Library/Mail
Users/YourUserName/Library/Mail Downloads
(Could be a different folder here if you chose such in Mail Prefs)
Right click on that Mail folder, choose archive, you'll get everything in the folder, and the folder itself in a file called Mail.zip, move it to a safe place, same for the Mail Downloads folder... only the plist is separate.
/Users/YourUserName/Library/Preferences/com.apple.mail.plist
Make a copy of this file also.