International arrivals come into BOS Terminal E. Domestic departures, with few exceptions, leave from one of the other terminals. There are no airside connections between terminals. You'll generally complete the customs and immigration process, exit Terminal E to a shuttle bus or a walking route (usually through the central parking garage; it's well signed) and enter the other terminal exactly like any other departing domestic passenger would. Before you do this, check what terminal your departure airline uses. (Regarding the two in your profile: DL uses A, AA uses B.)
If you have bags that were checked through to your final destination, you pick them up at E, clear customs with them, and re-check them at a drop-off spot immediately outside customs. You don't have to lug them to your departure terminal.