If its just "sometimes" it's likely a clutch issue. Could be flashing the clutch because of worn clutch discs or a cable adjustment issue.
Make sure the clutch lever on the transmission has a bit of slack when fully released. If not, adjust the handle lever untill it releases tension with just a bit of play in the case side clutch lever. Only run JASO MA2 certified oil ment for wet clutches.
If this has happened more than a couple times, even if the clutch discs are okay, it's likely glazed them. If the clutch cable adjustment was too tight, or you think the wrong oil was in it(and you put the correct in), you can try to brake the glaze loose. You run it to a mid rpm speed in a low gear(2nd or 3rd), grab the clutch, release it quick a handful of times letting off the throttle to lower rpm before releasing and throttling up. Hope that makes sense. You release the clutch on decel to the rpm to shock the discs. Still need a new clutch set soon.
I have had great luck with the Tusk clutch sets. I ride hard on the throttle and they seem to hold up. Their HD clutch springs are a great upgrade, too.