What is the best way (regarding performance) to set transients for logged in users?

The rule of thumb is not to do any caching, except for object caching, for logged in users. Actually IIRC object caching will give you exactly what you want.

But if you have to do it your way, you should make your cache keys to be based on the query and have different cache for different queries. A similar but maybe easier to grasp idea is do “group” users based on their settings and hold a cache for each group.

And btw transients are the wrong tool for caching, or to say it better, their use do not exempt you from doing cache invalidation as you usually don’t want a situation were you sent a notification about new post but no one can read it because the cache is stale.