Self-supervised Transformer with Energy-based Graph Optimization (STEGO)