You might also want to look at the clean_requirements_on_remove configuration option in /etc/dnf/dnf.conf.