I would use both "se targuer" and "se vanter" in saying the following, for instance, even if leaning towards "se targuer" a little bit:
Peu de gens peuvent se targuer de pouvoir discuter d'égal à égal avec Trump.
Peu de gens peuvent se vanter de pouvoir discuter d'égal à égal avec Trump.
As for the following two constructions, on the other hand, the use of "se targuer" seems odd, if not impossible:
Ce n’est pas pour me vanter, mais ...
Sans vouloir me vanter, ...
So there must be some differences to take note of between "se targuer" and "se vanter".