There is not an "easy" way to do this.
Here is a similar question...
Grabbing each frame of an HTML5 canvas
You could follow this approach and grab the frames and submit these to a server-side script to compile them into an animated GIF.
Another option, though non-trival, would be to implement a pure JavaScript GIF encoder. The GIF specification can be found here, http://graphcomp.com/info/specs/gif89a.txt
If the color table stays the same in each frame, you could probably splice together the frames from already encoded GIF urls without having to compress the pixel level data. You would still need to decode the base64 stream from Canvas.toDataURL.