I used
sbom4python -r pyproject.toml -o sbom-spdx.json --sbom cyclonedx
and found it to not include the transitive dependencies.
Running instead:
pip-compile -o requirements.txt ./pyproject.toml
and then
sbom4python -r requirements.txt -o sbom-spdx.json --sbom cyclonedx
includes the transitive dependencies as well.