You can make a dip bucket with the appropriate dosage of Flatworm Exit. If you use a coral dip like coral rx you will most likely kill all of the good pods and worms along with the flatworms. I would make a container of flatworm exit large enough for a rock or two, dip for 15-30 minutes, then dip them in a clean saltwater bath and shake them off, then add the rock to the new tank. You could always just remove your fish and shrimp, then treat the entire old tank, then remove the rock and rinse it in clean saltwater before adding to the new tank. Either way, as long as you kill most of them and don't transfer the dead bodies to the new tank, you could retreat the new tank a couple of days later to remove any of them that made it through the first treatment. It is the dead bodies that can be toxic in high numbers, not necessarily the flatworm exit. I would probably do the dip/bath method rather than the in tank to avoid any undue stress on your livestock.