As you said, you could compute these features offline once and store them as an attribute inside the Dataset.
If you want to compute them in the first epoch using your DataLoader, you might want to use a shared array and store the features there (as shown here 3), so that they will be reusable in the following epochs from each worker.