The best advice I ever got was from the online course from Yamaha School of Champions. It's this:
When do you go to the brakes? When you get nervous.
When do you release the brakes? WHEN YOU ARE HAPPY WITH YOU SPEED AND DIRECTION.
When do you begin to accelerate? WHEN YOU CAN BEGIN TO TAKE AWAY LEAN ANGLE.
To me the biggest was being happy with your speed and lean angle. Trail breaking with that in mind helps me eliminate the "oh shit, am I in too hot?" feeling. If you feel your too hot, gently brake a little longer.
I know this doesn't address the peg issue, but like dragging a knee it shouldn't be the goal in a corner, rather control in the corner is much more important, and will reward you with more speed in the long run, and one day the peg will touch almost as a surprise. The online Yamaha School of Champions is well worth the money imo.