It can be a sign of worms, but in this case I would say its food related. Either your goat did eat something in the garden, that has not agreed with him, or its more than likely the change of feed. I would cut out the goat feed, and stick with hay, and plenty of water. Like you say its important not to let them get dehydrated.
Scour forumula powder - for calves, is what I use for my goats when they are like this. Its mixed in with water.