At this time there are not OS X virus in the wild so the potential to what one could do would be determined by their existence in the wild. It also depends greatly on your scope of "ransomware"
If your system had some type of ransomeware compromise on the OS level then any backup you are making after that compromise is being replicated in some form so you are copying an already compromised local system.
If someone got hold of your Apple ID credentials (see next paragraph) and locked you out of your computer then the backup wont matter, you need to secure your ID.
If you share the same or similar log/pass combo with another service and that service is compromised then anyone with that information simply needs to try the same combo elsewhere and enable two factor authentication if you have not done so already. Yahoo, Twitter, Facebook, etc. have an astronomically larger user bases so they are inherent targets of account hacks. I don't know of an instance where Apple has had their account service hacked, outside of users clicking on phony links and providing their credentials to a site masquerading as iCloud or some "Apple" service page that is completely fraudulent. If you are concerned and you are not protecting your account then thats a mistake.
And if you are running some form of AV on your mac you are likely causing problem and not protecting against anything.