Well, let's just say you can't tell until you're there.
I found out the hard way that a portion of slalom was too fast to keep in 1st gear. I asked the same question and decided on some trial and error. Unfortunately, my 212k mile 3.0 and faulty oil pump dictated that 8,000 rpm was too much. A spun bearing later answered my question.
Basically, you want to keep it as much in the 4,500-6,000 rpm range as possible. Unless you have Stage II cams or something. Try to keep your shifts to an absolute minimum. Even if there is a part of the course that makes your revs drop to 3,000 for a short time, you may want to stay in 2nd so you don't lose time on your shift. You will feel as though you're losing time but you'll be amazed at how you don't. And stay as smooth as possible.
Really, you want to find another FWD owner, pick his brain as much as possible and see if he'll ride with you. That and really learning the course layout will help you a bunch.
And plenty of seat time. boink