How to get Z position from a material World Position Offset?

I have a static mesh with a material that has a dinamic World Position Offset (an ocean).
I need to get the height of the wave (Z), so I need to get the World Position Offset variation given an X and Y.

Any guess how to get it?