How do I assign variables from FormatterBase-Interface to hook_page_attachments()?
No, you don't want to do this.

You can set #attached everywhere. hook_page_attachments() is just the global hook that allows to add attached things to all pages.

But you don't need this if you want to use #attached for own structures, just add them to your render array that you return.