Modeling multiband emissions from two young SNRs with a time-dependent magnetic field