This has previously been done for mlir-opt and mlir-reduce and roughly the same approach has been done here.
The use case for having a separate library is that it is easier for downstream to make custom TableGen backends/executable that work on top of the utilities that are defined in mlir/TableGen.
The customization point here is the same one as for any upstream TableGen backends: One can add a new generator by simply creating a global instance of mlir::GenRegistration.
Can we align the name of the cpp and the header?