Yeah, water is definitely added for hydrolysis. You have an OH from Glycerol added to the carboxyl group of the fatty acid, forming a COO ester and giving off a H2O molecule.
The only way you're gonna get it back to the original is to add water, merely adding NaOH can't give the OH back to the glycerol, and H back to the carboxyl group.
So, first part of the transesterification is to hydrolyse the triglyceride into glycerol and 3 fatty acids. Second stage involves THEN reacting each fatty acid with methanol, to once again create an ester. But rather than having all 3 esters bonded to the glycerol molecule, you now will have 3 methyl esters and in the process 3x water molecules will also be given off.
Hope this answers your question...