Could be my eye-sight, but it looks like there is RTV-filled PVC conduit on them line conductors. I also note there is no neutral connection (that I can see), for the "new connection". It definitely screams DIY!
It really looks like they converted the downstairs to a separate unit and this is the service tap. There is a meter at the bottom of that raceway that starts around 3 rungs down from the top (you can see the svc head). If you look behind the 6th rung up from the bottom you see the metering equipment. The neutral loops in from the bottom. You really need to blow the picture up to see all of this.
That still doesn't answer the question of what the guy was doing up there.
Yes, a legal install. You can't see that there are two services on this duplex dwelling. The left SER cable is hidden by the wall corner. If you look hard you can see the right. What actually happened was the handy homeowner dude in the left unit was doing some siding repair and left the ladder up for the wind to take it and went home for the week! I was called to remove it! A little more chafing and who knows what would happen?