Mail.app quite easily saves messages (or groups of messages) as standard mbox files. Select the messages you wish to export, go to "File -> Save As..." and select "Raw Message Source" as your desired format.
If you're just looking to move messages to another server though, it's almost certainly easier to add a different mail server and drag/drop your messages to the new server.
Even easier if you want the whole thing, just right click on a mailbox and select "Archive mailbox...". It will save a copy in the mbox format in the location you choose.
If you're just looking to move messages to another server though, it's almost certainly easier to add a different mail server and drag/drop your messages to the new server.