There is no absolute answer to the question as to what is a safe slope in terms of degrees. There are lots of variables and factors to take into consideration.
1.
Up and Down Hills. Going up and down hills safely depends upon an awareness not only of the degree of incline, but the front-to-back center of gravity ("horizontal COG" or "weight balance") of your tractor plus attached implements, the vertical COG ("topheaviness") of your tractor+implements, the type of surface you are on (wet, dry, sandy, vegetated), and the type of tires (contact traction) you have.
Just guessing, but I doubt many would try a 40 or even a 35 degree slope under any condition. The lack of traction of the surface or your tires, or both, may limit your ability to climb a steep hill even if you could otherwise do so. You really don't want to try to climb steep hills with slippery traction because you may end up slipping and sliding into a sideways position--and the sideways position is where the roll potential dramatically increases.
Ideally, if driving hills, the horizontal COG of your tractor+implements should always be midway between your front and rear axles--i.e., an even weight balance from front-to-rear. That way, you can drive up hills or down hills in a forward direction without having to worry about which end of your tractor is heavier and hence tippier. On a hill, the horizontal COG will always shift further to the downhill side of the tractor, thereby increasing the tendency of the uphill wheels to lift off the ground as you get on the hill. Therefore, if you are imbalanced and heavy on one end, you should face the heavy end of the tractor uphill when you go up or down hills (meaning you drive backwards if necessary). By doing this, you shift the COG away from the heavier uphill end, and reduce the likelihood that the uphill wheels come off the ground.
You should also lower your vertical COG as much as possible by lowering your implements as low as possible whenever you are on a hill. Wheel weights or loaded tires will also lower your vertical COG permanently and give you more stability.
2.
Sideways on Hills. In general, not a good idea, physicsically or mentally. Dangerous slide and roll potential. You will get nervous at 15 degrees, and that's a good thing. I have been at about 23 degrees on my tiltmeter, but not intentionally. At 23 degrees I backed carefully out of the situation (wheels falling into a little hole or gully while on a hill), and was seriously considering unbuckling and jumping off the tractor (on the uphill side). The width and
ballast of your tractor makes a big difference in this uncomfortable situation. The wider and farther apart your wheels are, the more stable you will be. Same rules re implements: lower them. Again, wheel weights or tire ballast will permanently lower the base tractor's vertical COG and increase stability.
Common sense rule: go slow, be very careful, and pay attention to gut fear and feel. Consider buying a tiltmeter--not because it can provide absolute safety or unsafety rules, but because it can add visually to your gut feel as you develop more experience.