Short Answer: They aren’t
From the time of this novel’s initial conception it was a thought experiment. The aim was to investigate would would have happened to the Harry Potter plot with the addition of the mind and skill of the detective Sherlock Holmes. And of course, for the experiment to remain an experiment, Harry Potter had to remain untouched except for that one addition.
Now, the time in which this takes place is a slightly nebulous ‘contemporary/modern’. The fact that Sherlock and John communicate by cellphone might lead some to insist that this takes place at a somewhat later than the official time period of the Harry Potter books. But, as far as I can see, the effect that this slight implied movement of time has on the implied Harry Potter time-line is precisely nil.
There is truly only one thing different in this story from the Harry Potter canon, and that is Sherlock Holmes meets Harry, Ron, and Hermione in the little café on Tottenham Court Road. Everything before that was exactly as it was in the original. And all the changes that follow arise solely from that one alternation.