Associated production of a top quark pair with a heavy electroweak gauge boson at NLO+NNLL accuracy