Hi,
GRE adds another layer3 to the existing layer3 packet.
IPSec transport mode adds a layer that sits between layer3 and layer4, to encrypt data within the layer4 PDU.
IPSec tunnel mode encapsulates existing layer3 packet in a new layer for encryption, then adds a new layer3.
So generally speaking, IPSec and GRE are said to be layer3 protocols.
Cheers:
Istvan