Polarization of radiation is a powerful tool to study cosmic magnetism and analysis of polarization can be used as a diagnostic tool for large-scale structures. In this paper, we present a solid theoretical foundation for using polarized light to investigate largescale magnetic field structures: the cosmological polarized radiative transfer (CPRT) formulation. The CPRT formulation is fully covariant. It accounts for cosmological and relativistic effects in a self-consistent manner and explicitly treats Faraday rotation, as well as Faraday conversion, emission, and absorption processes. The formulation is derived from the first principles of conservation of phase-space volume and photon number. Without loss of generality, we consider a flat Friedmann-Robertson-Walker (FRW) space-time metric and construct the corresponding polarized radiative transfer equations. We propose an all-sky CPRT calculation algorithm, based on a ray-tracing method, which allows cosmological simulation results to be incorporated and, thereby, model templates of polarization maps to be constructed. Such maps will be crucial in our interpretation of polarized data, such as those to be collected by the Square Kilometer Array (SKA). We describe several tests which are used for verifying the code and demonstrate applications in the study of the polarization signatures in different distributions of electron number density and magnetic fields. We present a pencilbeam CPRT calculation and an all-sky calculation, using a simulated galaxy cluster or a model magnetized universe obtained from GCMHD+ simulations as the respective input structures. The implications on large-scale magnetic field studies are discussed; remarks on the standard methods using rotation measure are highlighted.