I would think the problem is with the Garmin unit.
Disconnect the power from the bike and just use the internal battery, see if you get the same problem.
If you do try mounting it in a different position on the bike, less vibrations.
I will assume it works like my Zumos
If the problem is with the bikes power you should get a warning when the power is lost and it will give a countdown giving you a chance to stop it shutting down, but of course you have to be looking at the screen to see the countdown happen.
Disconnect the power from the bike and just use the internal battery, see if you get the same problem.
If you do try mounting it in a different position on the bike, less vibrations.
I will assume it works like my Zumos
If the problem is with the bikes power you should get a warning when the power is lost and it will give a countdown giving you a chance to stop it shutting down, but of course you have to be looking at the screen to see the countdown happen.