How do I keep track of player purchases if they get a new phone?

Google Play Services should keep track of your player’s purchases on their side. You don’t need to do it yourself to make anything related to In-App Purchases.

You can read official documentation (2) if you have questions regarding Mobile In-App Purchases.
You can Restore Purchases to get player owned items.