From what I understand, the NaOH is used to break apart the fatty acid from the glycerine, with a simple ester-base reaction. The fatty acid takes the Na, where the glycerine takes the OH. The newly freed fatty acid, now holding the Na in place of it's usual H, doesn't last too long. It quickly reacts with the methanol in the solution, to form a new ester, which is much more simple, and makes a much better diesel fuel than the triglyceride. The Na from the fatty acid then goes off to react and form NaOH, going back to it's original form, thus classifying it as a catalyst in this case.
The theory involving the NaOH stripping methanol of it's hydrogen, and creating water, is likely invalid, as any water present in the reaction will react with more NaOH and the triglyceride to form soap. This is the reason why triglycerides must be dried by boiling off the water before, before conversion to biodiesel.