Unity animator graph layer mixer playable

Hi everyone!, I would like to know how the animator manages layers, for example due to the fact that overide controllers don’t support layer masks, you can’t use 2 generic rigs with the same animator controller which have different bone names,
So I tried doing a search in the graph the animator creates to find layer mixer, it then sets the avatar mask directly, what I want to make sure is that this work reliably without issues, so any official unity mecanim devs plz let me know, also at runtime when changing something and it rebukds, we would like it to work correctly meaning our script be able to update too, so that it overrides the mask again, now not sure this is the best way ofc so let me know, finally if we can access layer mixer playable of the animator correctly , can we kick it out and replace it with our own script playable to get the features unity is adding such as per bone weights support and mesh space rotation etc