The mistake almost everyone makes is holding W — the forward key will slide you straight off the ramp.
Instead, as you jump onto the ramp, hold A or D depending on which side you're on. Surfing the left-facing slope of a ramp like .\, you hold D to press yourself against it. On the right-facing side, /.\, you hold A. Keep that key held and your momentum carries you along the surface rather than off it.