No, we've understood heredity for a very long time, and sex between siblings or between parents and children has always been a taboo. Cousin marriage, however, is not particularly harmful (https://www.psychologytoday.com/blog/animals-and-us/201210/t...).
The real reason we stopped marrying cousins is:
1. We started to live in large cities instead of on farms and ranches. (https://www.census.gov/population/censusdata/table-4.pdf)
2. We could reasonably travel more than 10 miles from home in a day.
In other words, we used to marry cousins because it was too difficult to find better prospects.