To do this, open the BMW Motorrad Connected app and select the route you have travelled under "Trips". Click on the menu at the top right and select "Export GPX" from the list to share the route, e.g. via AirDrop.
In the app, you can also restart recorded routes simply by clicking on "Ride again".