It could just be your Throttle safety system (TSS) You can normally bypass it for testing just by unplugging the connector that comes from the Throttle assy on the handlebars. if your problem goes away, then the problem is with your TSS and could be the switch in the throttle assy, too loose or too tight throttle cable, or some sort of grounding issue.
Id that test does not fix the issue, the problem could be a number of other things such as the Throttle position sensor, a clutch issue, or a spark issue such as a bad wire or plug cap.