If this were an on-prem Exchange you could use the Get-Message cmdlet. Unfortunately, that won't work with M365. I don't think there's any equivalent (like a "Get-EXOMessage") for M365.
You can try using Invoke-RestMethod (but I believe that's limited in the number of messages it can retrieve in one invokation), or resort to using Outlook (and MAPI) from your workstation. If you're adventurous, you can try using the Exchange Web Services (EWS). I believe the most recent version of that is 2.2.
See if this (as a starting place) is any help if you want to use Outlook: powershell-office-365-emils.html