Both options are possible. For a BulkConfiguration (not a device), it can be convenient to do optimization and analysis in a single script. But for DeviceConfigurations the geometry relaxation can require several individual steps, e.g. first optimize the central region and the optimize the device. In that case is it probably better to first do optimization and then do analysis (transport calculations) in a separate script.