This can be done with the engine in the frame, or with the engine removed. In the below example the starter cable has already been removed.
The starter motor is at the rear left hand side of the engine (left as if you were sitting on the bike):
There are two bolts holding it in at the rear; they’re visible on the right hand side in the above photo. Take an 8mm socket (or wrench if the motor is out of the frame):
Bolts out:
Now take a pry bar or screwdriver and place it between the starter motor and the engine;
It shouldn’t require much force to push the starter motor away from the engine:
This is what you should see:
Removed, along with the two bolts:
Short and sweet.