Have you considered that over the last few years security has risen considerably in prominence and as a result you have far more people working in the sector actively trying to find and then report on vulnerabilities in software. If you look at this
site showing CVEs by product going back to 1999 you'll see Debian Linux at the top with 3000, but if you look at the actual detail then over 1000 were reported in 2018 alone. Suggesting Windows 10 is not secure because it has almost as many CVEs recorded against it as Windows 7 did is just a really short-sighted interpretation of that data.
Vulnerabilities are always going to exist in software so the important statistic is how quickly a vendor is able to fix them once they're discovered. Windows has so much legacy code in that odds are any vulnerability discovered in Windows 10 is going to exist in earlier versions too, and unless you're a business who bought extended support or you're pirating the Windows 7 security updates they're never going to be fixed in Windows 7. As an end user of Windows the only thing you can do to keep your system as reasonably safe as possible is - as with any OS - to stay on the current version and install the monthly security updates as they're released.