Inferring resource competition in microbial communities from time series