I answered in the mentioned issue.
But for reference here too.
If you configure attributes on configurations, then this is just a local thing.
If you want it published and used by downstream projects, define the attributes on the dependency.
In your case I'd say the proper solution is to define a constraint for that transitive dependency that defines the attribute as shown in the diff I attached to that issue.