Turning a vector into a local offset? Math help

Ok, i have an object, A
And i have a point in space, B (its a vector3)

What i want to find, is B’s local offset from the location of A, expressed in A’s local axes. (A is at a random and arbitrary rotation)

I’ve gotten as far as B = B - A.transform.position;
This gives me an offset in world axes, which is nice but not useful. How do i convert that into A’s local coordinate system?

The Transform component provides a lot of great conversion tools, such as:

transform.InverseTransformDirection(your calculated offset);

It converts world directions to the local directions of the transform it is called on.