If you want to convert a world position to a local position you have to first determine which Entity is going to be the ‘parent’, since a local position only makes sense relative to some parent. So assuming you have that parent entity you can then do:
var mat = parent.getWorldTransform().invert(); // get inverse world transform of parent
var worldPosition = new pc.Vec3(5, 0, 0); // example world position
var localPosition = new pc.Vec3(); // example local position which will hold the result
mat.transformPoint(worldPosition, localPosition); // transform world to local
So in summary you get the world transform of the parent, you invert it and then you transform a world position to a local position.