Kobayashi geodesics and their modular forms