Forward hook, specific layer and user parameters

I want to save outputs of intermediate layers using hooks.
Two questions:

  1. Is it possible to pass a dictionary to a forward hook, and not use a global dictionary?

  2. Can we identify a specific layer inside the hook function, and not just the module name(using self.__class__.__name__ )?

Thanks