The day before is the way we backshift yesterday into the past tense. The same template is used for other temporal expressions which ordinarily take Speech Time as their Reference Time: last night, tomorrow, last week, next week and so forth, using the T before (T representing a unit of time such as day or week) or a T earlier for expressions designating an earlier time or date and the T after or a T later for expressions designating a later time.
In your passage for instance, the day before means the day before the day Harry expressed this wish. At the time, Harry would have said "She gave us a huge pile of homework yesterday".
If this passage had occurred two days after the homework was assigned, Harry would have said "She gave us a huge pile of homework day before yesterday" and JKR would have report it as "It hadn't stopped her from giving them a huge pile of homework two days before", or "two days earlier".