How could I add custom advancement?

If it is possible, how could I do that?
I have use the advancement.builder to build an advancement, but I don’t know how to register that.