Mine was doing this last month, didn't notice it until I finished the headlight delete, air temp relocate and added an LED bar.You ever find the fix for this mine is currently doing this
Not sure if any of those caused it, as I hadn't started it in over a year due to the recoil starter blowing up on me.
I then installed a load resistor into the other headlight socket (high beam) and that fixed the resetting issue at higher rpms, if I switch to low beams (no load) it resets everytime I exceed 2000 rpm which leads me to believe its my voltage regulator needs replaced.
This is just a bandaid fix in my case but you could have an entirely different gremlin.
Have you checked your voltage output when idling vs higher RPM?