In the realm of spatially resolved transcriptomics (SRT) and single-cell RNA sequencing (scRNA-seq), addressing the intricacies of complex tissues, integration across non-contiguous sections, and scalability to diverse data resolutions remain paramount challenges. We introduce STEP (Spatial Transcriptomics Embedding Procedure), a novel foundation AI architecture for SRT data, elucidating the nuanced correspondence between biological heterogeneity and data characteristics. STEP's innovation lies in its modular architecture, combining a Transformer and β-VAE based backbone model for capturing transcriptional variations, a novel batch-effect model for correcting inter-sample variations, and a graph convolutional network (GCN)-based spatial model for incorporating spatial context, all tailored to reveal biological heterogeneities with unprecedented fidelity. Notably, STEP effectively scales to the newly proposed 10x Visium HD technology for both cell type and spatial domain identifications. STEP also significantly improves the demarcation of liver zones, outstripping existing methodologies in accuracy and biological relevance. Validated against leading benchmark datasets, STEP redefines computational strategies in SRT and scRNA-seq analysis, presenting a scalable and versatile framework for dissecting complex biological systems.