For centuries, cousin marriage went back and forth between being acceptable, even preferred, to being banned. It depends on the time period and the place. But it seems as the 19th century ended, the tide was turning firmly against it -- in 1886, Louisa May Alcott could have a character being sweet on his cousin in her book Jo's Boys and it was fine, but by 1896, when Jude the Obscure was published, Jude and Sue's relationship is frowned on because "it is not well for cousins to fall in love." In 1921, when a set of cousins marry in the Forsyte Saga, the author lets us know that the pair had decided to have no children together on account on them being first cousins.
That's really pretty fast, if you think about it. Jane Austen's Mansfield Park, in 1814, has as it's triumphant happy ending that Fanny marries her cousin Edmund. Less than a hundred years later, cousin marriage is now something that, if the pair insists on marrying, they ought not to have children. There's probably a few factors at work. Eugenics and early theories of hereditary were coming into vogue, and the same people who'd inbred their horses and dogs to get an animal of the type they wanted may now have been having second thoughts of doing such things with humans. Economically, things were changing in the Western world and there may have been less pressure to marry cousins to preserve family businesses and family fortunes.
I also sort of wonder if genteel and middle-and-upper class women were becoming more liberated, and seeing more men outside the immediate family circle. Lower class women had been working in fields, fetching water from wells, tending to shops, etc. for centuries. But women from "good" families, who were more guarded and protected, had fewer opportunities to make the acquaintance of men. Of course, one's own cousin was acceptable to be around -- and who else did one have to fall in love with, other than one's cousin? But if you're starting to go about unchaperoned, perhaps even seeking higher education, you're going to meet more men who are not blood relatives that you can go falling in love with.