Its on a taper.
You usually have to use a gear puller on them, get everything good and pulling, and give it a sharp rap with a LIGHT hammer.
(as in lightweight).
With luck it will pop off.
Sometimes they can be a pig...
Don't be tempted to use a heavier hammer etc, the magneto shafts are fairly fragile if you force anything.
A bit of minor heat may assist too, but don't get the shaft, or the gear teeth seriously hot...