The answer is merely a matter of definition of "valence electrons".
Many texts define "valence electrons" in a way that explicitly includes $d$d electrons of unfilled (but not filled) $d$d subshells.
For example: Chemistry structure and dynamicsChemistry structure and dynamics by Spencer et al.et al. at page 125:[1]
We can define valence electrons as electrons on an atom that are not present in the previous rare gas, ignoring filled $d$d or $f$f subshells.
Many books published in the last 10 years use this definition.
That $d$d electrons may be valence electrons is also supported by the 18-Electron rule (at least to the extent that there is such a rule).
[1] James N. Spencer, George M. Bodner, Lyman H. Rickard: Chemistry: Structure and Dynamics, 5th Edition. John Wiley & Sons: 2010. ISBN: 978-0-470-58711-9