There’s a (free) addon called Ecosystem, which can you install and which gives you access to tons of additional actions and examples. Check for movement or direction actions. I recall there are 8 directional actions and suchlike.
Assuming physics. The conventional method would simply be to set velocity (every frame) upon entering the state, and checking the input if player goes into a different direction, with float compare. You can probably make it super condensed, write axis into a variable and set this on enter, but an easier and good enough beginner setup simply has one state per direction, and the Set Velocity fixed. E.g. x = -5 on walk left state, x = 5 on walk right state. Next improvement could be to put the input axis actions into a separate FSM, and write the two floats with Set FSM float into the movement one (where they are being compared to determine in which directional state it should be).