How to convert a world space coordinate into an object space coordinate?

It is very confuse to explain. I need to create a way to do Third peson character control with logic nodes (makes the character moves with WASD relatively to the camera direction).

I can achieve this by creating an input for Relative Object in Translate Object node. The problem is that this way is very limited (because can be used only for Translate Object).

In translate object, if you check the On Local Axis checkbox, the translate method will be applied related to the direction of the object, you just need to select another object (that is the reference object) and set the camera object (or its axis object) in this case, and the character will move relatively to the camera.

I only want to know the math behind this method, to convert a given vector to a object space and apply it where it is needed. I will take a deeper look as soon i can, but maybe someone already know how to achieve this.