Funnily enough, the same issue crops up in my own industry of the chemical industry (I kid you not) on how to label pipelines, when they cross multiple areas of a plant (because, like 'counties' they also have different 'area numbers'). The general rule is that they are labelled as to where they originate from (where they start), it make the whole job a lot easier especially as things get moved around (like areas of a county changing).

So as others have suggested, if the relative was in Derbyshire based on their town at that time of that record, then they are best recorded as being in Derbyshire even if the boundaries change which puts them into Leicestershire later on.
We had a bit of a similar dilemma of how to name the counties on RootsChat when Sarah and I set it up, and that's why we stuck to the county names as of 1851-1901, as that encompassed almost all the census dates that we available almost ten years ago when we set up the site.
Trystan
RootsChat Caretaker