For example, you can generate a new identifier using Guid.NewId and store it to local storage (https://learn.microsoft.com/en-us/windows/apps/design/app-settings/store-and-retrieve-app-data) if it was empty. Use the stored value if exists.
However, it will be lost if the Operating System or hardware is changed. Maybe it has sense to have user accounts too.