How many miles on your bike? That sounds like one of the symptoms rectified by the "upgrade kits" that Triumph provided for the '06-'09 class of bikes. They supposedly made changes to subsequent production bikes afterward...your bike should have had the "fix". The upgraded parts incorporated back angle grinds on the gear teeth to ensure engagement during peak loads, such as under acceleration.
When the detent spring breaks, the bike will jump out of gear the instant you roll off the throttle, regardless of what gear you are in. Keeping your foot on the shifter after the shift is made, maintaining upward pressure after an up-shift or downward pressure after a down-shift, will keep it in gear.