hhmmm... in earlier versions of AE,
mask("Mask 1").maskPath.value.toSource();
would give you some number, that doens't imply the shpae, but would change when the shape changed...
it now seems to be gone. :-(
no dispair!
it can get a bit messier, but still solvable!
add a mask to your own layer, connect it to that other mask you want to track,
and add a hidden mask param to your effect reading your own local mask.
when the user changes your target mask, it changes your local mask, and the mask param triggers a re-render.
perhaps there's also a way to make that local mask invisible by making it's stream hidden...