They fingerprint your browser, IP address and usage history. I can bring back my entire YouTube recommendations (many completely unrelated subjects) even in a private browsing window by watching just one or two videos (I guess it isn't sure at first whether I'm the same person or someone else, but one or two videos, combined with IP address is enough for them to be reasonably confident it's me and bring back my previous recommendations).
I'm not using the same IP address nor the same browser. I've never seen my recommendations being remotely similar. When I view logged out via another browser in private mode all I get are the generic "popular in your region" videos.
I also never notice the videos I'm watching logged out affecting my recommendations when logged in. That doesn't mean I'm not being tracked but without actual proof I'll continue to consider it mostly a conspiracy theory.
It's still attributed to you.