Agree with flying out to BOS and back from JFK
My (personal) view would be to spend a bit more time in New York than Boston given the relative sizes of the cities and things to do (Manhattan itself has plenty let alone Brooklyn and Queens as well which many avoid but there are parts worth visiting) but as you have three weeks that won't be much of an issue, you may even have time to visit other places in NY state.
If you don't want to hire a car, the Acela express train from BOS to NYC is a pleasant experience, a comfortable journey and some nice waterside scenery for a lot of the way - Edit: sorry just seen you are considering that already.