To the OP: what time of day is your transfer? This greatly informs my response. I often drive around town in the middle of the day, and I will just say that downtown traffic is very unpredictable. It is completely likely that 45 minutes would NOT be enough time in a cab. It is, however, also completely likely that 45 minutes will not be enough time to take the Orange Line. The orange line is pretty slow on the weekends - I have definitely missed my MBTA commuter rail train out of BON on weekends because I sat at Downtown crossing waiting 30+ minutes for the orange lin.
However, I would lean towards the Orange Line in this case, but some details about day of week and time of day would help guide me.
If I was going to take a cab, I would probably lean toward disembarking at BOS because there are always plenty of cabs there and it is a straight shot down the surface road to north station which generally moves pretty quickly. If taking the Orange Line, I recommend disembarking at BBY because you can take the orange line straight to BON. If you get off at BOS you have to take the red and then transfer at downtown crossing to the orange or transfer at park to the green line (NOT recommended).
I'm arriving at Back Bay station at 8pm on Thursday. In looking over my itinerary more closely, I believe I'll have more time before the train leaves Boston North Station than I thought:
Service: 176 Northeast Regional
Duration: 7h 55m
<Departs>
Washington - Union Station, DC (WAS)
12:05 pm
<Arrives>
Boston - Back Bay, MA (BBY)
8:00 pm
<Seat(s)/Room(s)>
1 Reserved Coach Seat
Amenities: Snack car
------------------------------------------------------------
Service: 2689 Self Transfer
Duration: 0h 10m
<Departs>
Boston - Back Bay, MA (BBY)
10:00 pm
<Arrives>
Boston - North Station Maine Service, MA (BON)
10:10 pm
<Seat(s)/Room(s)>
1 Unreserved Coach Seat
Amenities: ------------------------------------------------------------
Service: 689 Downeaster
Duration: 1h 28m
<Departs>
Boston - North Station Maine Service, MA (BON)
11:20 pm
<Arrives>
Dover, NH (DOV)
12:48 am
<Seat(s)/Room(s)>
1 Reserved Coach Seat
Amenities: Snack car"
And reverse:
Service: 680 Downeaster
Duration: 1h 33m
<Departs>
Dover, NH (DOV)
6:52 am
<Arrives>
Boston - North Station Maine Service, MA (BON)
8:25 am
<Seat(s)/Room(s)>
1 Reserved Coach Seat
Amenities: Snack car
------------------------------------------------------------
Service: 2680 Self Transfer
Duration: 0h 9m
<Departs>
Boston - North Station Maine Service, MA (BON)
9:02 am
<Arrives>
Boston - Back Bay, MA (BBY)
9:11 am
<Seat(s)/Room(s)>
1 Unreserved Coach Seat
Amenities: ------------------------------------------------------------
Service: 93 Northeast Regional
Duration: 7h 45m
<Departs>
Boston - Back Bay, MA (BBY)
9:40 am
<Arrives>
Washington - Union Station, DC (WAS)
5:25 pm
<Seat(s)/Room(s)>
1 Reserved Coach Seat
Amenities: Snack car