Avoiding New York State is pretty much unavoidable. Avoiding New York City is easy and will probably cut time from you trip. Depending on where you are starting from there are different route options. Depending on where you're starting from and where in Maine you're heading two days travel might be optimistic. I've made three trips from eastern MA to the Austin area and the best I could do was three days.
The route from the Austin area would be I-35 to I-35E to I-20 around Dallas to I-30 East. In AR, take I-40 east all the way through to I-81 in Knoxville. There are two Buc-ees on I-40. You'll continue north on I-81 through VA. Note that the Virginia State Police very aggressively enforce the speed limit. Anything more than 5mph over the limit gets you stopped and cited.
Stay on I-81 north through VA, WV, MD*, and into PA. If you have a Texas LTC you're good in TN, VA, WV, and PA. In PA, there is a Petro truck stop in Scranton. It's off of Exit 178B on Grove St. in Dupont. Metro Deli makes great subs and they are huge. In Scranton you are going to get on I-84 North. Continue on that all the way through PA and NY. It's a very boring drive. Some areas have little to no food options.
At the far end of I-84 in PA you can get off and stop at a gas station in New Jersey. Gas prices there are much cheaper than either NY or NJ. Technically it's the last exit in NYS. Take a left at the bottom of the ramp and you'll be in New Jersey. You can't pump your own gas in New Jersey. Get back on and continue through New York into Connecticut.
Note that the state troopers in NY and PA sit on the median strip monitoring traffic, not on the sides of the road.
Continue through CT. In Hartford you can go north on I-91, but that's going take you into Vermont and add a lot of time to the trip. Continue on I-84 into MA. Gas in CT is very expensive, so I usually stop at the Pilot just over the line in Sturbridge, MA to top off my tank.
I-84 ends a few miles into MA and gets you on to I-90 (MA Turnpike). Take that East until you get to I-495 North. That will take you to I-95 north of Boston. From there you go into NH and then ME.
I wrote all of that presuming that you've never done the trip before.
In any state where you don't need a LTC which doesn't have reciprocity with TX, follow the Firearms Owners Protection Act (FOPA) requirements. In a nutshell, gun unloaded and locked in a box not easily accessible to the passengers. Magazines unloaded and not easily accessible to the passengers. Ammunition in a locked box and not easily accessible to the passengers. I think that the empty magazines can be locked in the box with either the gun or the ammunition, but they have to be empty. Don't take my word for it, check the law.
You probably already know this, but don't consent to any searches. Upstate NY isn't supposed to be too bad. MA is terrible, make sure that everything is properly locked up. Possession of a gun or ammunition without a MA LTC is against the law. Any magazines with more than 10 round capacity are also against the law. I don't know if CT requires a permit for possession or not. NH and ME don't require permits at all just like Texas.
I don't know what kind of vehicle you're planning on using, but with my Tacoma I got gas in VA and that carried me all the way through to the NY/NJ/PA stop. Gas in Sturbridge may not be necessary and you can wait until you get to New Hampshire depending what mileage you get.
Feel free to ask any questions either in this thread or by Direct Message.
*Note the MD is very anti gun. Not as bad as NY, NJ, or MA, but not good.