Many physically inspired general relativity (GR) modifications predict significant deviations in the properties of spacetime surrounding massive neutron stars. Among these modifications is f({mathcal {R}}, {mathbb {T}}), where {mathcal {R}} is the Ricci scalar, {mathbb {T}} is the trace of the energy–momentum tensor, the gravitational theory that is thought to be a neutral extension of GR. Neutron stars with masses above 1.8 M_{odot } expressed as radio pulsars are precious tests of fundamental physics in extreme conditions unique in the observable universe and unavailable to terrestrial experiments. We obtained an exact analytical solution for anisotropic perfect-fluid spheres in hydrostatic equilibrium using the frame of the linear form of f({mathcal {R}},{mathbb {T}})={mathcal {R}}+beta {mathbb {T}} where beta is a dimensional parameter. We show that the dimensional parameter beta and the compactness, C=frac{2GM}{Rc^2} can be used to express all physical quantities within the star. We fix the dimensional parameter beta to be at most beta _1=frac{beta }{kappa ^2}= 0.1 in positive values through the use of observational data from NICER and X-ray Multi-Mirror telescopes on the pulsar {textit{PSR J0740+6620}}, which provide information on its mass and radius. The mass and radius of the pulsar {textit{PSR J0740+6620}} were determined by analyzing data obtained from NICER and X-ray Multi-Mirror telescopes. It is important to mention that no assumptions about equations of state were made in this research. Nevertheless, the model demonstrates a good fit with linear patterns involving bag constants. Generally, when the dimensional parameter beta is positive, the theory predicts that a star of the same mass will have a slightly larger size than what is predicted by GR. It has been explained that the hydrodynamic equilibrium equation includes an additional force resulting from the coupling between matter and geometry. This force partially reduces the effect of gravitational force. As a result, we compute the maximum compactness allowed by the strong energy condition for f({mathcal {R}}, {mathbb {T}})={mathcal {R}}+beta {mathbb {T}} and for GR, which are C = 0.757 and 0.725, respectively. These values are approximately 3% higher than the prediction made by GR.. Furthermore, we estimate the maximum mass Mapprox 4.26 M_{odot } at a radius of Rapprox 15.9 km for the surface density at saturation nuclear density rho _{text {nuc}} = 2.7times 10^{14} g/cm^3.