Although this is an old question, I am posting the solution I worked out.
Basically, subtract the current player position from the last player position and normalize it. That is your movement direction. Now make a dot product between the movement direction and the world up axis (for example (0,0,1)) and this gives you a value between -1(downwards) and 1(upwards). Also works for moving sidewards on a slope which gives you something close to zero (basically not moving upwards or downwards).
I multiply that value with 90 and feed it into a float curve for finetuning the slope factor. For example my float curve points are (time/value) -90/2, -10/1, 10/1, 45/0.5, 50/0.