Here’s a minimalistic Pawn approach:
Velocity magnitude mapped to pitch.
It will need extra work if the leaning is supposed to work in all directions.