Mimecast does not as yet publish a public API for large scale data extraction.
You can extract a given mailbox or set of data from Mimecast by using Administrator rights to export the results of an eDiscovery search to PST or EML files.
This, however, is a very lengthy and manually intensive approach that is not suitable for large volumes.
Another approach is to request a bulk-export of emails.  This data will typically presented in a single-instanced stream of emails in PST or Zipped EML files.
The challenge with this is that your emails will not exported according to individual user mailboxes and and does not preserve any folder structure.
Transvault is able to take this pool of emails and reconstruct it into separate user mailboxes.  It can also create a new email folder structure based on meta data such as ‘Sender’ and  ‘Date’ to give users the most meaningful way to navigate their migrated email records. Find out more about our Mimecast migration service.
At the same time you can output data in the required format for ingestion into your new target cloud service, be it Office 365 or elsewhere.