Reach rank 59 and the crown hat is awarded to you automatically at that point.
There is no purchase, no code and no condition beyond the rank itself, which makes it one of the more straightforward rewards in the game. The only work involved is the climb, and ranks come from completing races rather than from any single achievement.
If you are close and it has not appeared, check that the rank display has actually updated, since the reward is granted on arrival at 59 rather than on the following login. Refreshing the page usually resolves any display lag.