Flow-based Sampling for Entanglement Entropy and the Machine Learning of Defects,