have an animation that is a left step and another that is the right step. Those animations stop at the idle pose relative to forward foot. Keep track of what animation ended or started (or both) either through anim notify events or through some other logic that keeps track of left/right foot forward.
This usually only occurs when a fighter intentionally changes stance though. Most people have a dominant foot or (lead foot) that they rest forward. Your forward step would most likely be dominant foot forward and trailing foot catch up animation or some kind of “strafe” like motion.
You could also use the same setup used to explain Anim Montage ( with some modifications of course):