You replace GameRegistry.registerRecipe(...) with a call to Foo.registerRecipe(...) where Foo is whatever you named the class with that code in it.
Then, when you run the game, it will generate a bunch of json files in the config/recipes folder.
You then copy these files to your assets and disable the Foo.registerRecipe(...) calls.
Just be aware that every time you run your mod and the recipe stuff is enabled, it will generate a bunch of files. It makes no attempt to delete any and will just use new names for the same recipes/advancements.
Since the recipe registration event (which you should now use for recipes) fires after configurations load, you can simply check the configuration values during the handling of the event. Note that I cover this along with some other tips about the 1.12 recipe system in my tutorial tips here: http://jabelarminecraft.blogspot.com/p/minecraft-modding-ore-dictionary.html
See also my reply post at the bottom which also supplies some code to generate the advancements (although the trigger conditions still need to be adjusted manually).