In track view, right-click on the clips pane for a track that has Guitar Rig inserted. Choose Envelopes, then Create Track Envelope, then Guitar Rig. You'll see a list of all the parameters that can be automated. The one you want is "Wahwah-Pedal Pedal" (or maybe "Talk Wah Mouth" or "Talk Wah Size", depending on which effect you're using.) Put a check beside it, and hit OK.
Edit that new envelope as you would a volume or pan envelope. If you need some background on how to do that, there's a chapter in Sonar's Help file called "Using Automation."