We present deep optical imaging of the z = 4.1 radio galaxy TN J1338-1942, obtained using the Advanced Camera for Surveys (ACS) on board the Hubble Space Telescope, as well as ground-based near-infrared imaging data from the European Southern Observatory (ESO) Very Large Telescope (VLT). The radio galaxy is known to reside within a large galaxy overdensity (both in physical extent and density contrast). There is good evidence that this region is the progenitor of a present-day rich galaxy cluster. TN J1338 is the dominant galaxy in the protocluster in terms of size and luminosity (in both the optical and near-infrared) and therefore seems destined to evolve into the brightest cluster galaxy. The high spatial resolution ACS images reveal several kiloparsec-scale features within and around the radio galaxy. The continuum light is aligned with the radio axis and is resolved into two clumps in the i775 and z850 bands. These components have luminosities ~109 L☉ and sizes of a few kpc. The estimated nebular continuum, scattered light, synchrotron- and inverse Compton-scattering contributions to the aligned continuum light are only a few percent of the observed total, indicating that the observed flux is likely dominated by forming stars. The estimated star formation rate for the whole radio galaxy is ~200 M☉ yr-1. A simple model in which the jet has triggered star formation in these continuum knots is consistent with the available data. A striking, but small, linear feature is evident in the z850 aligned light and may be indicative of a large-scale shock associated with the advance of the radio jet. The rest of the aligned light also seems morphologically consistent with star formation induced by shocks associated with the radio source, as seen in other high-z radio galaxies (e.g., 4C 41.17). An unusual feature is seen in Lyα emission. A wedge-shaped extension emanates from the radio galaxy perpendicularly to the radio axis. This naturally connects to the surrounding asymmetric, large-scale (~100 kpc) Lyα halo. We posit that the wedge is a starburst-driven superwind associated with the first major epoch of formation of the brightest cluster galaxy. The shock and wedge are examples of feedback processes due to both active galactic nucleus and star formation in the earliest stages of massive galaxy formation.