Here's some detailed info:
http://codetuto.com/2017/02/direction-vectors-godot-engine/
Transform is an object containing a matrix 32 for the direction(rotation) and a Vector3 for location (x,y,z)
http://docs.godotengine.org/en/stable/classes/class_transform.html#class-transform
Transform has two public attributes.
origin
The origin is a simple Vector3 with the x/y/z coordinates.
In global context (get_global_transform().origin) these are the absolute coordinates in 3D context. Simple.
If the object is a child object of another spatial, then (get_transform) these are the local coordinates inside the parent objects coordinate space.
For example:
You have an airplane (parent) and on the "back" of the airplane there's a rudder (as child). The airplane is (initially) facing to negative z. This rudder is i.e. 3m back from the center (0,0,0) of the plane. Then it's local origin is Vector3(0,3,0).
When the plane moves 10m meters forward then the planes origin (global and local) changes to (0,-10,0).
The rudders local origin stays the same (get_transform().origin) but the global origin (get_global_transform().origin) changes accordingly to (0,-7,0)
When instead, the plane turns instead 90° around the y-axis to the left. The global origin of the rudder changes to (3,0,0). The local origin stays at (0,3,0).
basis
This is a Matrix32. It contains 3 x Vector3. One for each axis. These vectors tell where the original x/y/z Vectors point after the rotation.
So if the object points forward (I mean: no rotation). Then the vectors are like this:
basis.x = Vector3(1,0,0)
basis.y = Vector3(0,1,0)
basis.z = Vector3(0,0,1)
You rotate the object 90° to the left (around y-axis) then the values are like this
basis.x = Vector3(0,0,-1)
basis.y = Vector3(0,1,0)
basis.z = Vector3(1,0,0)
For distinction of global/local when can look at a tank as example. The tank has a rotating turret as a child object.
Now the tank itself is following a course and is rotated.
The turret is also rotated relative to the parent. (Shows to a different direction than the tank.)
Now you could get the local rotation vector for z with:
get_transform().basis.z * -1
(-1 is only multiplied here to get the "forward" direction)
Might be useful if you want to move some other child object relative to the turret in code. (The value above shows the relative positional offset 1m to the front of the (locally) rotated child.)
But much more interesting in this case it is to get the global direction of the turret.
get_global_transform().basis.z * -1
will give you the absolute forward direction vector of the turret. I.e. useful for raycasting and/or moving bullets/rockets.
Angles vs. vectors:
You have to get used to the aspect that the direction is defined by vectors and not by angles. There are reasons for this (gimbal lock) which I won't (and probably can't) detail here. You should just avoid angles as much as possible when calculation with rotation in 3D as you often won't get usable results. Generally it should be ok to use set_rotation() on spatials but don't expect to get the same angles back on get_rotation() ;-)
Hope I didn't do any errors in the samples.