That's too broad a question to answer with much specificity.

Generally speaking, a background script is required for dynamic reforms. The script looks for a defined set of triggers. These can be, for example, a specific turn number, ownership of a set of settlements, the presence of a building or buildings, the existence of a trait or ancillary, or any combination of these things. When the conditions are satisfied, the script places a building in one or more settlements. That building may directly allow the player to build new (reform) units or it may permit construction of a building which enables recruitment of reform units.