It appears to be a very intensive process! You need to get some outside chemicals, so the loop could never be closed on this unfortunately. It would be easier simply to buy the inoculant than to track down mannitol or dipotassium phosphate most likely, but if you're curious I've done the research and written up a how-to:
The bacteria nodules in the roots are harvested from successful nitrogen-fixing plants of the same species about to be planted, especially if you know those plants were inoculated beforehand. Harvest the nodules during flower. The nodules take the shape of rounded bumps forming on the roots.
The bacteria is extracted from the nodules, and placed in a sterile test-tube culture of “yeast mannitol broth.” The broth is made by combining 1 gram of brewer’s or baker’s yeast-water culture, 10 grams of mannitol (also known as “baby laxative”), 0.5 grams of dipotassium phosphate, 0.2 grams of magnesium sulfate, 0.1 grams of sodium chloride, and 1 gram of calcium carbonate to give the broth a pH of 6.8. The ingredients are combined in 1,000ml of distilled water, and heated just to boiling, then mixed well. The yeast mannitol broth is stored at below 86 degrees Fahrenheit in a tightly-sealed container.
The Rhizobia bacteria is introduced to the yeast mannitol broth, and incubated at 77 degrees Fahrenheit for 3-5 days, and then introduced to a larger 10-gallon fermenter with the same type of yeast extract medium at a temperature of 80 degrees Fahrenheit. An air hose is run down to the bottom of the fermenter, introducing heat-sterilized air bubbles. The bacteria is allowed to ferment in this medium for 72 hours.
Directly applying this bacteria liquid culture to the seeds or soil is ineffectual, and instead it needs to be inoculated into peat, which serves as the “carrier” for inoculating the seeds. Peat is superior to all other carrier candidates, everything from biochar to
compost to plant meal. The harvested peat is dried at temperatures never exceeding 200 degrees Fahrenheit, and then ground into small bits. The peat’s high acidity needs to be neutralized to a pH of 6-7 with use of calcium carbonate.
Before adding the bacteria liquid, the peat should have a moisture level of 7%, and after the liquid is added it should have a moisture level of 40-50%, as anything higher or lower than this means bacteria will probably not survive. The liquid culture is blended with the dried peat carrier, and then spread in shallow layers to cure in open air at room temperature for several hours. The inoculant should be stored in a glass bottle plugged with sterilized cotton or wool. The bacteria is sensitive to heat and sunlight, and should be kept in a dark, cool place.
It’s impossible to overuse inoculant with seeds, and you may want to use an extra-large dose of inoculant if planting the seeds in soil where the species has never grown before, or the soil is poor, or there is less rainfall than usual. To inoculate the legume seeds, first coat the seeds in a sticky mixture of 1 quart milk and 2 tablespoons of molasses, and then sprinkle the seeds with the peat inoculant. The inoculated seed should be planted immediately, and if not planted in 4 hours, they should be inoculated again. Sowed seed should be covered with soil or mulch immediately to prevent the sunlight from killing the bacteria. The soil should be watered immediately if it is dry, to improve the bacteria survival rate.