of the garage from the house. If the house has been there for many years, I don't think there is a risk of cold waterline gets frozen but you want to insulate the hot waterline to save some energy. You can buy pipe wrap insulation for the right size for your waterline.
Ideally the electric water heater should be in the house in northern states, but I don't think you can move it easily inside without incurring significant expenses of moving electric and water lines.