I didn't keep track of the time involved, but once it got started it seemed to get worse at an increasing rate. I have no proof of cause, but this is a fairly common problem, at least on XRs, and the consensus on the XR forum seems to be that hard a aftermarket sprocket is the culprit.
I bought the bike used, and the sprocket that was on it was hard to get off. I didn't think to inspect the shaft at the time, but I think the damage had started with that sprocket.
After a season (two?) on the new sprocket, the damage was obvious, but less bad than in the below pic. I noticed the keeper had strange wear on it, so I pulled the sprocket, and found the damage. I foolishly hoped it would not get any worse, but after not-enough-hundred miles more, it looked like this.
I knew it was doomed, so just put it back together and kept riding. After an even shorter period of time it looked like it did in the first pic.
At that point I figured all was lost, and with nothing to lose, I welded the sprocket to the shaft to get some more mileage before changing the shaft.
The first sign of danger is a keeper that looks like this. But, I think that once the destruction starts, it will continue until it strips completely no matter what you do.
Though I can't be positive the sprocket caused this, I think it is likely enough to warrant never using aftermarket primaries again. The OEM sprocket for the XR is not only the proper hardness, but it also has a wider cross-section, or so I am told.