It isn't possible to output a water mask as such at the same time as your beauty, but here's what I would do:
You'll have to do two renders, but set it up using render layers. Create two Render Layers. The first one will be a layer that just contains the water (I'll call it "Water Layer"), while the second one contains everything else ("Terrain Layer"). I'll assume that you have a Lake object and it's in the Water group in the node network. On your Water Layer's Objects tab, use the '+' to the right of "Object group 1" to assign the "Water" node group. Now look at the bottom where it says "All other objects". Change that render mode to "Holdout" and enable "Cast shadows and other rays". This will cause everything that's not in the Water group to black out and occlude the water but still be visible in reflections and GI and cast shadows on the water.
At this point you could also set up output paths and such so that you can render all your elements out (rgb, alpha, reflections etc.) or if you just want a beauty and an alpha it's pretty straightforward. Connect the Water Layer to your render node and render the image. You can save this image and its alpha channel from the Render View. (Press 'A' to view the alpha channel and then you can save the alpha channel.)
The Terrain Layer is set up in almost the same way as the Water Layer, but the render modes are reversed. As before, assign the Water group to "Object group 1", but this time change its render mode to "Holdout". You can leave "Cast shadows and other rays" enabled for the water group. For "All other objects" set the render mode to "Visible" and enable "Cast shadows and other rays".
Matt