I am trying to implement a “dash” mechanic and i am a little confused on how to make the direction of velocity boost be the same direction of this raycast (for example).
You need to take the transform, or global_transform and use the basis vector x, or y, depending on what you consider the “front” of the sprite. Since the basis vector is normalized, meaning its length is one, you multiply it by your speed, or acceleration, constant to move in the direction of the current rotation.
For Transform2D they dont call it a basis but just x and y. And every Node2D has a transform and global_transform property.
I would suggest always using global coordinate variables, unless you have a specific reason to do it in local space.