The easiest way to do that would be using a strip shaped mesh along which you can scroll a texture. Here’s a good explanation of how to do them: VFX Basics - Mesh Soulercoasters. The way people usually refer to this technique is “soulercoasters” as it resembles a soul going through a rollercoaster, not sure if that post is what started it.
In the case you shared it’s probably a particle system that spawns a soulercoaster mesh with a random rotation. If the mesh geometry is offset from its center, like in the gif below, the random rotation will make them behave in a similar way to your reference.
A similar effect could also be achieved with trails but that would probably make things more complicated and take away some control over the result, so I’d stick to soulercoaster meshes for this one.
Edit: Niels beat me to it