Tracking resilience to infections by mapping disease space