How should one maintain a relationship with a professor? So I am planning to apply to grad school sometime in the future and would need a letter of recommendation from an awesome professor who I took a time series class with. 

I got an A- in the class, he liked my final project a lot and I know he remembers me but how do I maintain a good relationship with a professor after I've graduated?
If you don't plan to work with or take courses from this professor in the future, I advocate getting a letter of recommendation now instead of waiting. Services such as Interfolio allow your letter writers to upload a letter now that you can send out to any recipient at any time. This way, the professor still remembers you well; I can tell you from experience that after a couple of years of teaching large (>100 student) classes, even my better students start to fade together in my memory.