A Nonparametric Framework for Time-dependent SIR Models with Application to COVID Data