Procedural shader Creation

In the example of Epic games - Talisman, somehow the developers link from a Material Instance to another Material Instance. And through it, they manage the selection of one of the ready-made instances. Does anyone have any ideas how this can be implemented in the engine?

Presets on the mesh are switched via Custom Primitive Data