Probably a particle plugin like Trapcode Particular or Stardust could be an option. Another option is to use the Vegas effect (Generate category). With this effect you can create lines based on masks, add segments and animate the evolution parameter to create the animation.
Let's start with the basics. CC 2021 can create tapered lines. Bevil Alpha can simulate a tube, Dashes, Gaps, and Offset can create movement in the lines. Glow and Motion blur can add to the effect. The bottom path was created first, then duplicated and dashes, gaps, and offset were set up, the color changed and the width, then the blend mode was set to add and glow and CC Force Motion blur polished up the look. This took me less than 5 minutes using the rotobezier pen tool on a shape layer. I'm showing you all of the settings including the time - 1800 expression is in Offset to make the dashes move.
That is only one of about 20 ways I can think of to make this happen without any 3rd party plugins. The best workflow depends on your design. AI paths can be copied and pasted. Simple AE paths without brush strokes can be converted to shapes that just have a path. There are lots of ways to create something like your example.