.magnitude on a local level?

hi all!

Is there any way to use .magnitude in a local way?

I have a thePlayer placed in another object.

I currently have this sitting in the Update function but it works on a global level

 if(thePlayer.transform.position.magnitude < 40) {
//do stuff
}

localPosition?