On the determination of the number of factors using information criteria with data-driven penalty