How to calculate capacitor to fix a brownout
Total energy is measured in watt-seconds (Ws or W-s).  Your brownout is approx 4 ms (3.36 ms in one trace), and lets say the transient current is 500 mA.  The total energy you need to make up is (3.3 x 0.5 x 0.004) = 0.0066 w-s.  Not much.

Regulator output (3.3 V) plus headroom (0.32 V) = Vin(min) - 3.62 V.  Lets round that up to 4.0 V for margin.

Total energy (in w-s) in a capacitor is 1/2 C V^2.  During the transient, the input capacitor discharges from its nominal value to the minimum regulator input value.  If the nominal Vin is 5.0 V (for example), then removing 0.0066 w-s of energy from the capacitor discharges it from V1 to V2 (5.0 V to 4.0 V).  

0.0066 = 1/2 x C x (5.0^2) - 1/2 x C x (4.0^2)

Moving the pieces around:

C (in farads) = (0.0066 x 2) / (25 - 16) = 1466 uF

Note:  This example has a lot of worst-case assumptions and margin.  It is for a complete blackout, where the input voltage source goes to 0 V for 4.0 ms.  A shorter transient period, higher input voltage, and lower transient current all work to reduce the size of the holdup capacitor.

In this example, the resulting capacitor size is relatively high because the allowed voltage drop is so small.  Increasing the nominal input voltage by only one volt decreases the capacitor size by over 50%.