Have you checked out this page?
https://docs.godotengine.org/en/stable/tutorials/3d/procedural_geometry/index.html
Basically you'll take the position of the node that has the trail and generate new vertices from there and add them to a mesh.
For something simpler, you could try to make a 2D trail and then use billboarding to always keep it facing the camera, although I'm not sure how good that would look
Godot Engine documentation
There are many ways to procedurally generate geometry in Godot. In this tutorial series, we will explore a few of them. Each technique has its own benefits and drawbacks, so it is best to understan...