This is years old. She wasn’t doing this while working in gov.
- you're well connected
- you'll be back in government as soon as the administrations change.
Or do you really think Biden (or Trump, or DeSantis, or whoever you want) would have chosen as secretary the bank administrator of Springfield Oklahoma's largest credit union? That would be daft.
So the relevant part is that "unemployed" Yellen was "[..] the Federal Reserve chair from 2014 to 2018."
When her term ended: "She took in the speaking fees in 2019 and 2020."
And, after an arduous two year job search she's a cabinet level secretary regulating those she collected fees from.