Interesting setup!
I recreated it here: (there's two skeletons to replicate both gifs!)
single-direction-transform-constraint.spine
This setup relies on the transform constraint mimicking the translation of the target having Local
checked and being parented to a bone where one of the two scale values is set to 0.
Very nice to move shadows and similar!