For either of these vaccines even if some part of the delivery/packaging mechanism, such as the lipid enclosure, is carcinogenic, you are only getting a small amount and only getting two short exposures. It seems like that would make the cancer rate from them so low as to be almost impossible to detect.
However, the body is a complex system; if something in the vaccine triggers a change in function, that could lead to side effects that are only detected years later; most likely through epidemiologic studies comparing those who got the different types of vaccines with those who didn't.
Of course, the disease itself has potential long term effects as well; and has already been studied to have significant medium term effects.
Some viruses are known to cause: https://en.wikipedia.org/wiki/Infectious_causes_of_cancer#Vi...
Right now our best guess is these vaccines are safe but there is no guarantee of that.