Linking object position to another object
If I got it, you can parent the head to some top vertices of the scaled object, like this




first, set the origin of the scaled object to its base face





then select just the top face of the same object



 - then in object mode select the head and after also select the body




then parent and set parent to "vertex"




now, when you scale the body on Z, it will be based on its base, so the top face will move, and the head will follow, as shown above.

here is a test (simplified) file to test