It is part of the key sig., but not the key sig. When a key changes - often accompanied by a double bar line, the natural/s are put in to cancel any previous # or b that were in the previous key, as a courtesy reminder only at the beginning of the new key.
Here, it's gone from A major (F#m) with 3# to D (Bm) with 2#. Thus, the writer shows that the G# is no longer needed, and puts a natural in its place. Note that it's only there for the beginning - at the start of the next line, there's the standard two sharps of the new key sig.
I've had several longish pieces that change key, and the new key sigs are only put in at the beginning of each section - not repeated in the traditional way at the start of each line. Unusual, but not really a problem, once it's got used to. After all, we don't expect to see the time sig. repeated at the start of each line, do we...