In regression analysis, how does one know which transformation to apply to either the response variables or features?

I'm guessing looking at a plot of the data would give one an idea but I'm not entirely sure