On the NYC public transit system (subways and busses), there is 4 to 6 felonies per 1mil rides per year. That means, if you ride the public transit system twice a day, every day... you will, on average, be assaulted once every 274 years.
In comparison, the US as a whole has a violent crime rate of 369 per 100,000 per year (2019). Or about about an average of 271 years for you to be a victim of violent crime. NYC has a slightly higher violent crime rate of 404 per 100,000 (2020) and is fairly safe as far as US cities go.
In other words, the risk of violent crime rate by being a heavy user of public transit in the largest city of the USA is about the same as the overall violent crime rate of the USA as a whole.