Sorry for not replying to this thread sooner, I missed the email notification.
The temporary ID is stored in the UserAuthenticationGUID field of the CMS_User table and can be accessed via the UserAuthenticationGUID property of the User object using the API.
I also believe that once it is entered it remains there until the user authenticates using it in at which time it is removed and the field will either be null or an empty guid.
This should satisfy your requirement, since it would be generated in code and then the user is immediately transferred to a page which will authenticate it and remove it, so the entry should only exist for a small fraction of time.