I'm sure those with more experience than me would know more, but if it's leaning off at the top end i.e. starving itself of fuel, then it will stop revving out. It might also be the exhausts are a bit coked up. Start with the cheap stuff to check before throwing money at the problem. Will it rev out in neutral or is it under load when it stops ?
Think, Consumables fail/wear/get blocked.
IMO I'd go
Check jets and needles std settings
New plugs, maybe plug caps
Plug Chop - will tell you whats going on
Adjust the jetting accordingly or come back and ask again
HTH