I put up some kind of tutorial which deal with 3D Transforms. Perhaps it is helpful:
https://godotdevelopers.org/forum/discussion/18480/godot-3d-vector-physics-cheat-sheet
It also deals with the difference between local and global transforms.
To your problem:
As I understood A is a child of P.
So its transform is local to P.
If you want to move A inside the parents transform (= as a child) in its x-direction I'd say that this is the code:
NodeA.transform.origin += NodeA.transform.basis.x * distance
This'll change the local position of Node A in direction of its local transform x-Vector by distance units.
Example: Be P be a moving and turning ferry. Be A some person on that ferry.
The person now wants to move 2m left (x-axis). Then their local position should change by NodeA.transform.basis.x * 2.