You can use a capacitor, but you need quite a big one depending on how much your Arduino consumes. 3 seconds at - let's say - 5 mA is 15 mC (Q=I*t), that at 12 V are stored in a 1.25 mF capacitor. 

$$\left( C = \dfrac{Q}{V} \right) $$

The problem is that the voltage will decrease linearly if you drain a constant current, and below a certain voltage your Arduino will turn off. If you put the capacitor before the voltage regulator it will store more charge for the same capacity value, and - more important - the regulator will allow a wider voltage range, so you'll be able to use better the capacitor.

Since the Arduino accepts 7-12 V supply, you have a 5 V range to have the capacitor discharge. Again, 15 mC over 5 V means 3 mF, so with a 5 mF capacitor you should be able to keep it alive.

>**Note:** I don't know what your Arduino should do, so the power that it will consume; size your capacitor accordingly.

About how to connect it, I'd suggest a resistor and a diode in the lighter socket side, to prevent too fast charge of the capacitor and to avoid its discharge towards the lighter socket.

So, summarizing, if I is the average current absorbed by your Arduino, 7-12 V is its supply voltage range, the minimum capacitor size you need will be approximately:

$$ C = \frac{Q}{\Delta V} = \frac{I \cdot t}{\Delta V} = \frac{I \cdot 3s}{12V-7V} = \frac{3s}{5V}I $$