Holographic multiple-input multiple-output (HMIMO) is a potential technique for improving spectral efficiency (SE) while maintaining low hardware cost and power consumption. Although conventional alternating optimization (AO) methods are widely adopted for optimizing the digital and holographic beamformers, their high computational complexity hinders real-time deployment. Deep learning provides an alternative with low inference latency, where graph neural networks (GNNs) have attracted considerable attention due to their ability to exploit permutation equivariance (PE) properties. In HMIMO systems, the optimal beamforming policy exhibits PE properties across multiple dimensions, which can be leveraged by GNNs. However, designing a single GNN to exploit the PE properties in all dimensions results in large model sizes and substantial training complexity. To address this issue, we first transform the beamforming optimization problem to optimize an equivalent beamformer and the holographic beamformer. Then, we propose a novel network architecture consisting of a gradient-based graph neural network (GGNN) followed by two projection modules, which first learns the equivalent beamformer and holographic beamformer and subsequently recovers the digital beamformer from the equivalent beamformer. Simulation results demonstrate that the proposed method achieves higher SE with reduced inference latency than the AO baseline and exhibits superior generalization performance compared with existing learning-based approaches.