There are no "rules", but...
Lol!!!
The forward lean is a "fool the eye" kind of thing. It foreshortens the image. It's all about perspective.
It makes a longer trunk appear to be shorter than it actually is. Which allows there to be more branches. And gives more depth to the composition.
It also elicits an emotional in the viewer. Trees that lean forward a bit appear to be inviting the viewer to come take a closer look. Trees that lean back appear aloof, unfriendly.
How much is enough? As with all things bonsai the answer is "it depends". Rather than specify a geometrical number of degrees, I think it helps to look at how the tree is planted in its pot. Generally speaking, the trunk should be planted in the center of the pot as viewed from the side, and slightly to one side or the other when viewed from the front. The apex in most situations should, when viewed from the side appear to be over the soil in front of the trunk but not so far forward to be over the front edge of the pot. When viewed from the front, the lean foe are should be subtle, almost unnoticeable. If it looks like it's trying to reach out and grab you, it's too much!
Ok, here are some old pics of my tree to illustrate:
The front:
Picture taken from the left of tree:
The front is on the right. As you can see, the trunk is planted in the center of the pot, and it actually appears to move towards the back until about half way up! From there, the trunk moves forward towards the front. The apex is forward of the base of the trunk but does not lean forward beyond the front rim of the pot.
The back:
From looking at this picture, it would be hard to tell if it's the back, maybe. Other than the foliage obscures the trunk. Well, the lighting is brighter on the lower foliage on the left, and the apex is darker, which does make it look like its farther away.
And finally, the other side of the tree:
This image shows the major flaw with this tree: the key branch! The key branch, the lowest one on the right side, is in the back! Horrors! Lol!!!
So, about a year from now, it will time to address that. I've been working it up for the National Show, and then over the next year, it will go into the Regional shows I participate in. Then, it will be time to cut back and restyle. I plan on putting in a few grafts where it needs some branching closer in to the trunk. And somehow, figure out how to bend that key branch to come forward more.
But I think it is a good illustration of how to use the forward lean to good effect.
Note: a true formal upright should be perfectly straight up. Like a Christmas Tree.