There's a bolt inside the case that should hold it in place.
See part number 20 here. https://www.partzilla.com/catalog/honda/atv/2007/trx500fm-a-fourtrax-foreman-4x4/gearshift-drum
You have to remove the rear engine cover to get to it.
See part number 20 here. https://www.partzilla.com/catalog/honda/atv/2007/trx500fm-a-fourtrax-foreman-4x4/gearshift-drum
You have to remove the rear engine cover to get to it.