How do I obtain the local velocity of a Rigid body on one axis?

I'm creating a simple driving game were the player controlled vehicle is a single box-like rigid body.

I am accelerating the vehicle with rigid.body.AddRelativeForce and I'm steering the object with rigid.body.MoveRotation.

I really need to be able to obtain the relative velocity along the vehicles local X axis (forwards and backwards) to be able to script rules and logic from, and right now all I seem able to do is get either the world velocity (rigidbody.velocity) or all-axis-combined velocity (rigidbody.velocity.magnitude) but neither of these are accurate enough for what I want to do.

Can anyone offer any hints here?

Thanks.

Try (untested):

float xVel = transform.InverseTransformDirection(rigidbody.velocity).x;

Is this what you are looking for?

(transform.rotation * rigidbody.velocity).x

Use `rigidbody.velocity.x`. Is that what you're looking for?