Judges have previously ruled that training counts as sufficiently transformative to qualify for fair use: https://www.whitecase.com/insight-alert/two-california-distr...
I don't know of any rulings on the context window, but it's certainly possible judges would rule that would not qualify as transformative.