This is how we can tell if there is no session in the [19888] or if the session that exists is anonymous.
It is valid both for GAM - Auto-register anonymous users and for knowing if the session is anonymous in web applications (Anonymous Sessions in GAM - Web Applications).

&GAMSession = GAMSession.Get(&GAMErrors) //&GAMErrors is a GAMError collection data type, &GAMSession type is GAMSession
If &GAMSession.IsAnonymous
       //Anonymous user
Else
       //Registered user
Endif

This is how we can find out if the SD application has an auto-registered user:

If &GAMUser.IsAutoRegisteredUser
       //Anonymous user
Else
       //Registered user
Endif

See also

GAM - Auto-register anonymous user - Panel usage example