Is it possible to contribute to academic research after retirement from the industry? Currently, I have a master’s of science in mathematics and a potential plan to couple my qualifications with a masters of science in analytics. I am actually nowhere close to being retired in the industry. But thinking way beyond the scope of the near future, I am curious if there is any possibility for someone who officially is retired from the industry to contribute to academic research? If so, how should a recent graduate prepare himself to make this a possibility. 

Ideally, I would like to contribute to research in machine learning after completing a rewarding career as a data scientist. I have been continually expanding my knowledge by reading mathematical references on the train ride to work each day.
A non-negligible amount of people start a PhD after retirement from industry. Depending on where you are in the world, if there are coursework requirements, having a master's may exempt you, so this can give you a fairly unrestrictive but very beneficial environment to do research in. If furthermore you have a comfortable retirement package and don't need funding you will be a very attractive candidate.