Yes, of course you can use the cooking liquid from the gammon instead of stock/water to make soup. It will be very tasty. If the gammon was a little fatty, I would suggest letting the liquid go cold, so that any fat can settle on top, this will make it easier to remove, and then continue to make a soup, or anything you wish to make with the stock.