CG Shader that lerps color based on height

The more a mesh goes up, i want the color to lerp to transparent. Can someone please guide me to a good source? There are literally no good cg tutorials that explain the pipelines and the meaning of certain keywords.

Use ZWrite Off for most transparent shaders so the object doesn’t write to the depth buffer and stop objects behind it from being rendered.