The Discourse version you’re running includes an aws-sdk-s3 version that should provide Aws::S3::TransferManager.
Are you using the official Discourse Docker installation? If you’re using the official Docker setup, was the container fully rebuilt as part of the upgrade?